package com.monkey.web.context.strategy;

import com.monkey.core.domain.BaseEntity;
import com.monkey.core.web.response.MonkeyResponseDto;

/**
 * Project  : monkey
 * Author   : Wu Tian Qiang
 * Date     : 2016/9/1
 */
public class BaseEntityCtrlReturnValueHandler extends AbstractCtrlReturnValueHandler {

    @Override
    public boolean support(Object returnValue) {
        return returnValue instanceof BaseEntity;
    }

    @Override
    public MonkeyResponseDto handle(Object returnValue, String fieldStr) {
        Object data = exportResultData(returnValue, fieldStr);
        return new MonkeyResponseDto().success("操作成功", data);
    }


}
